Skip to content

Expand VX runtime commands and subscriptions#683

Open
drew-y wants to merge 12 commits into
mainfrom
drew/v-408-expand-vx-runtime-commandssubscriptions-and-typed-payload
Open

Expand VX runtime commands and subscriptions#683
drew-y wants to merge 12 commits into
mainfrom
drew/v-408-expand-vx-runtime-commandssubscriptions-and-typed-payload

Conversation

@drew-y

@drew-y drew-y commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add named VX browser command constructors and default host handlers for clipboard, document title, history/navigation, URL hash, window scrolling, DOM text selection, opening URLs, and local/session storage writes/removals.
  • Add typed payload subscription helpers for runtime/custom subscriptions, keyboard payload handlers, online/resize/visibility, location changes, window focus/blur, animation frames, media queries, storage events, and BroadcastChannel messages.
  • Document the command/subscription host contracts and add unit plus smoke coverage for payload mapping from compiled Voyd code.

Validation

  • npx vitest packages/vx-dom/src/__tests__/browser.test.ts packages/vx-dom/src/__tests__/app-runtime.test.ts apps/smoke/src/vx-dom.test.ts
  • npm run typecheck
  • npm test (rerun with local socket access after sandbox blocked std-http listener creation on 127.0.0.1)

Review

  • Agentic implementation-gap reviewer: no findings.
  • Agentic correctness reviewer: no findings.
  • Follow-up correctness reviewer before final push: found URL notification and storage nullability issues; both fixed.
  • Final follow-up correctness reviewer after fixes: no findings.

@linear

linear Bot commented Jun 21, 2026

Copy link
Copy Markdown

V-408

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf00c1213a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/std/src/vx.voyd

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1708be9abb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/vx-dom/src/browser.ts Outdated
@drew-y drew-y force-pushed the drew/v-408-expand-vx-runtime-commandssubscriptions-and-typed-payload branch from 1708be9 to 71bf8b9 Compare June 29, 2026 16:06

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 71bf8b9216

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/vx-dom/src/browser.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 062ac87c27

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/vx-dom/src/browser.ts Outdated
Comment thread packages/vx-dom/src/browser.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3581fb61f2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/vx-dom/src/browser.ts
Comment thread packages/std/src/vx.voyd Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9157b18843

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/vx-dom/src/browser.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce7d38cbce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/vx-dom/src/browser.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3ae355be0f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/std/src/vx.voyd Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 41bc8c0e59

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/vx-dom/src/browser.ts Outdated
Comment thread packages/vx-dom/src/browser.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

voyd/packages/std/src/vx.voyd

Lines 2310 to 2311 in b985fb9

out.set("key", key)
out.set("event", kind)

P2 Badge Keep keydown and keyup subscriptions distinct

When an app batches keyboard_on_key_down(key: "Escape", ...) with keyboard_on_key_up(key: "Escape", ...), both helpers emit kind: "keyboard" with the same stable key, while the runtime subscription identity is based on kind:key. The second descriptor therefore replaces the first during sync, so one of the two listeners never runs; include the event name in the stable identity or store the browser key filter separately from the subscription key.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/vx-dom/src/browser.ts Outdated
Comment thread packages/vx-dom/src/browser.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2195071adb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/vx-dom/src/browser.ts Outdated
Comment thread packages/vx-dom/src/browser.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 84aa0424ed

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1446 to +1447
const dispose = await runner(subscription, mappedContext.context);
active.set(key, {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Register eager subscriptions before their initial dispatch

When built-in runners such as online_status, window_resize, visibility_change, and media_query call context.dispatch() during setup, this await yields before the record is inserted into active. If that initial message's step removes or replaces the subscription, the nested sync sees no active record to dispose, then the outer sync resumes and stores a listener the app no longer requested; subsequent browser events keep dispatching from a stale subscription. Insert the active record before setup can run queued initial messages, or defer those initial emits until after active.set.

Useful? React with 👍 / 👎.

Comment on lines +1283 to +1284
if (context.deferAfterCommands) {
context.deferAfterCommands(dispatchInitial);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Cancel deferred location emits when disposed

When a step installs location_change and one of its commands synchronously dispatches a message whose resulting step removes that subscription, the disposer runs but the queued dispatchInitial callback remains in the outer command phase. After commands finish it can still dispatch a location message for a subscription that is no longer active, so apps can receive stale route updates after unsubscribing; make the disposer mark this initial callback as cancelled before it runs.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant